Stereo cameras have been used that can measure the distance to an object. For example, techniques have been in practical use that control a vehicle by measuring the distance to an object existing in front of the vehicle by using a stereo camera (hereinafter referred to as an “in-vehicle stereo camera”) mounted on the vehicle. The distance measured by using the in-vehicle stereo camera is used in alerting a driver and controlling the brake, steering, and/or the like for the purpose of preventing a crash of the vehicle, controlling the distance between vehicles, and others.
General in-vehicle stereo cameras are installed inside a windshield of a vehicle, because higher durability particularly in water resistance and dust resistance is required of an in-vehicle stereo camera installed outside a vehicle. A stereo camera installed inside a vehicle photographs views outside the vehicle through the windshield. General windshields, however, have a complexly curved shape, and the shape is distorted compared with optical parts such as a lens inside a camera. A windshield thus causes distortion on images photographed through the windshield.
Techniques to correct an image photographed by a stereo camera are conventionally known. For example, Japanese Patent No. 4109077 describes a device that transforms each of a pair of image data output from a pair of cameras constituting a stereo camera by using a calibration parameter based on a deviation in coordinates between one of the image data and the other image data and adjusts optical distortion and a positional deviation in the stereo camera through image processing.
Such conventional techniques can correctly calibrate a deviation (hereinafter referred to as a “relative positional deviation”) in a parallax (a relative position) between object images on a pair of image data; however, those techniques cannot correctly calibrate a deviation (hereinafter referred to as an “absolute positional deviation”) in coordinates of the object image on the image data due to a transparent body such as a windshield. This configuration problematically causes an error on three dimensional coordinates, which indicate the position of an object, when the three dimensional coordinates are calculated from the distance to the object calculated based on the parallax in the object image and from the coordinates of the object image on the image data.
In view of the above, there is a need to provide a calibration method, a calibration device, and a computer program product that can accurately calibrate an absolute positional deviation in image data due to a transparent body.